#include "osObjects.h"                                          // RTOS object definitions

/*----------------------------------------------------------------------------
 *      Mutex creation & usage
 *---------------------------------------------------------------------------*/
 

osMutexId mid_Thread_Mutex;                                     // mutex id
osMutexDef (SampleMutex);                                       // mutex name definition


int Init_Mutex (void) {

  mid_I2cMutex = osMutexCreate (osMutex (I2cMutex));
  if (!mid_I2cMutex) {
    ; // Mutex object not created, handle failure
  }
  
  mid_TimeMutex = osMutexCreate (osMutex (TimeMutex));
  if (!mid_TimeMutex) {
    ; // Mutex object not created, handle failure
  }
  
  return(0);
}
